// 最长递增子序列 nums = [10,9,2,5,3,7,101,18] =》[2,3,7,101]   因此长度为 4 

/**
 * @param {number[]} nums
 * @return {number}
 */
var lengthOfLIS = function (nums) {
  let result = 1
  let len = nums.length

  let dp = new Array(len).fill(1)

  for (let i = 1; i < len; i++) {
    for (let j = 0; j < i; j++) {
      if (nums[j] < nums[i]) {
        dp[i] = Math.max(dp[i], dp[j] + 1)
      }
      result = Math.max(result, dp[i])
    }

  }
  return result
};


console.log(lengthOfLIS([0, 1, 0, 3, 2, 3]));
